<?php
namespace Modules\ShopAdmin\Models;
class ShopCouple extends BaseShopModel
{	
	/**
     * @name  关联用户
     */
    public function user_to()
    {
        return $this->belongsTo('Modules\Admin\Models\User','user_id','id');
    }
	/**
     * @name  列表数据处理
     */
	public function data_list($data){ 
		foreach($data as $k=>$v){
			$data[$k]['nick_name'] = $v['user_to']['nick_name'];
			$data[$k]['phone'] = $v['user_to']['phone'];
			unset($data[$k]['user_to'],$data[$k]['user_id'],$data[$k]['updated_at']);
		}
		return $data;
	}
}
